package cn.rkylin.oms.sysOrder.dao;

import cn.rkylin.oms.sysOrder.domain.SysOrder;
import cn.rkylin.oms.sysOrder.domain.SysOrderGoods;
import cn.rkylin.oms.sysOrder.vo.SysOrderVO;

import java.util.List;
import java.util.Map;

/**
 * 系统订单数据访问层接口
 *
 * @author wangxing
 * @version 1.0
 * @created 2017.09.14
 */
public interface ISysOrderDAO {

    /**
     * 获取系统的订单数据集通过多个平台交易号批量条件
     *
     * @param reqMap
     * @return
     * @throws Exception
     */
    public List<String> selectSysOrderListByTradeCode(Map<String, Object> reqMap) throws Exception;

    /**
     * 系统订单主表信息插入数据库
     *
     * @param record
     * @return
     * @throws Exception
     */
    public int insertSelectiveSysOrder(SysOrder record) throws Exception;

    /**
     * 系统订单商品明细信息插入数据库
     *
     * @param record
     * @return
     * @throws Exception
     */
    public int insertSelectiveSysOrderGoods(SysOrderGoods record) throws Exception;

    /**
     * 更新系统订单
     *
     * @param record
     * @return
     * @throws Exception
     */
    public int updateByPrimaryKeySelectiveSysOrder(SysOrderVO record) throws Exception;
    
    /**
     * 更新系统订单平台发货时间
     * @author jipengcheng
     * @param record
     * @return
     * @throws Exception
     */
    public int updateByTradeCodeSysOrderConsignTime(SysOrderVO record) throws Exception;

    /**
     * 获取系统的订单数据集
     *
     * @param reqMap
     * @return
     * @throws Exception
     */
    List<SysOrderVO> selectSysOrderList(Map<String, String> reqMap) throws Exception;

    /**
     * 获取系统订单商品明细数据集
     *
     * @param reqMap
     * @return
     * @throws Exception
     */
    public List<SysOrderGoods> selectSysOrderGoodsList(Map<String, Object> reqMap) throws Exception;

    /**
     * 更新合并前系统订单合并状态
     *
     * @param map
     * @return
     * @throws Exception
     */
    public int updateBeforeSysOrderStatus(Map<String, Object> map) throws Exception;

    /**
     * 获取系统的合并订单数据集通过多个合并前的平台交易号批量条件
     *
     * @param reqMap
     * @return
     * @throws Exception
     */
    public List<SysOrderVO> selectCombSysOrderListByTradeCode(Map<String, Object> reqMap) throws Exception;

    /**
     * 更新系统订单完成状态
     *
     * @param record
     * @return
     * @throws Exception
     */
    public int updateSysOrderFinishStatus(SysOrderVO record) throws Exception;

    /**
     * 更新系统订单商品明细
     *
     * @param record
     * @return
     * @throws Exception
     */
    public int updateByPrimaryKeySelectiveSysOrderGoods(SysOrderGoods record) throws Exception;

    /**
     * selectDeletedSysOrderGoodsList:选择合并后已删除的系统订单商品. <br/>
     *
     * @author zhanghao
     * @param tempQueryMap
     * @return
     * @throws Exception 
     */
    public List<SysOrderGoods> selectDeletedSysOrderGoodsList(Map tempQueryMap) throws Exception;

}